home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DJEMU106.ARJ / E42.CC < prev    next >
C/C++ Source or Header  |  1991-04-25  |  735b  |  45 lines

  1. #include "emu.h"
  2. #include "rmov.h"
  3. #include "compare.h"
  4.  
  5. void emu_42()
  6. {
  7.   if (empty())
  8.     return;
  9.   if (modrm > 0277)
  10.   {
  11.     // 
  12.     emu_bad();
  13.   }
  14.   else
  15.   {
  16.     // fcom m64real
  17.     reg t;
  18.     r_mov((double *)get_modrm(), t);
  19.     int c = compare(st(), t);
  20.     int f;
  21.     if (c & COMP_NAN)
  22.     {
  23.       exception(EX_I);
  24.       f = SW_C3 | SW_C2 | SW_C0;
  25.     }
  26.     else
  27.       switch (c)
  28.       {
  29.         case COMP_A_LT_B:
  30.           f = SW_C0;
  31.           break;
  32.         case COMP_A_EQ_B:
  33.           f = SW_C3;
  34.           break;
  35.         case COMP_A_GT_B:
  36.           f = 0;
  37.           break;
  38.         case COMP_NOCOMP:
  39.           f = SW_C3 | SW_C2 | SW_C0;
  40.           break;
  41.       }
  42.     setcc(f);
  43.   }
  44. }
  45.